﻿<div id="wrap">
    <div data-ng-include src="'views/shared/_nav.html'"></div>
    <div class="container admin-views-main admin-views-dashboard" data-ng-controller="DashboardController">
        <div id="modal-log-file" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                        <h4 class="modal-title">{{lbl.logFile}}</h4>
                    </div>
                    <div class="modal-body modal-logfile">
                        <div class="form-horizontal clearfix">
                            <div class="col-md-12" data-ng-repeat="log in logItems">
                                <div ng-bind-html="log.OptionValue"></div>
                                <hr />
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-ban"></i> {{lbl.close}}</button>
                        <button data-ng-if="logItems.length > 0" data-ng-click="purgeLog()" class="btn btn-danger"><i class="fa fa-times"></i> {{lbl.purge}}</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="row view-dashboard">
            <div class="col-xs-6 col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseOne">{{lbl.stats}}</a>
                        </h4>
                    </div>
                    <ul class="list-group panel-collapse collaps in" id="collapseOne">
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content?fltr=pub">{{lbl.publishedPosts}} <span class="badge pull-right active">{{stats.PublishedPostsCount}}</span></a></li>
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content/pages?fltr=pub">{{lbl.publishedPages}} <span class="badge pull-right">{{stats.PublishedPagesCount}}</span></a></li>
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content?fltr=dft">{{lbl.draftPosts}} <span class="badge pull-right">{{stats.DraftPostsCount}}</span></a></li>
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content/pages?fltr=dft">{{lbl.draftPages}} <span class="badge pull-right">{{stats.DraftPagesCount}}</span></a></li>
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content/comments?fltr=apr">{{lbl.approvedComments}} <span class="badge pull-right">{{stats.PublishedCommentsCount}}</span></a></li>
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content/comments?fltr=pnd">{{lbl.unapprovedcomments}} <span class="badge pull-right">{{stats.UnapprovedCommentsCount}}</span></a></li>
                        <li class="list-group-item"><a href="{{SiteVars.RelativeWebRoot}}admin/#/content/comments?fltr=spm">{{lbl.spamComments}}<span class="badge pull-right">{{stats.SpamCommentsCount}}</span></a></li>
                    </ul>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseTwo">{{lbl.latestComments}}</a>
                        </h4>
                    </div>
                    <ul class="list-group panel-collapse collaps in " id="collapseTwo">
                        <li class="list-group-item" data-ng-repeat="comment in recentcomments ">
                            <span><a href="{{comment.RelativeLink}}" target="_new" class="text-ellipsis">{{comment.Title}}</a></span>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-xs-6 col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseThree">{{lbl.draftPosts}}</a>
                        </h4>
                    </div>
                    <ul class="list-group list-group panel-collapse collaps in" id="collapseThree">
                        <li class="list-group-item clearfix" data-ng-repeat="post in draftposts">
                            <a href="{{SiteVars.RelativeWebRoot}}admin/editor/post.cshtml?id={{post.Id}}&returnUrl={{SiteVars.RelativeWebRoot}}admin/#/" class="text-ellipsis pull-left">{{post.Title}}</a>
                            <a title="{{post.Title}}" class="external-link pull-right" target="_new" href="{{post.RelativeLink}}"><i class="fa fa-external-link"></i></a>
                        </li>
                        <li ng-if="draftposts.length == 0" class="list-group-item">{{lbl.empty}}</li>
                    </ul>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseFour">{{lbl.draftPages}}</a>
                        </h4>
                    </div>
                    <ul class="list-group list-group panel-collapse collaps in" id="collapseFour">
                        <li class="list-group-item clearfix" data-ng-repeat="page in draftpages">
                            <a href="{{SiteVars.RelativeWebRoot}}admin/editor/page.cshtml?id={{page.Id}}&returnUrl={{SiteVars.RelativeWebRoot}}admin/#/" class="text-ellipsis pull-left">{{page.Title}}</a>
                            <a title="{{page.Title}}" class="external-link pull-right" target="_new" href="{{SiteVars.RelativeWebRoot}}page/{{page.Slug}}"><i class="fa fa-external-link"></i></a>
                        </li>
                        <li ng-if="draftpages.length == 0" class="list-group-item">{{lbl.empty}}</li>
                    </ul>
                </div>
                <div class="panel panel-default panel-trash">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseFive">{{lbl.trash}}</a>
                            <small ng-if="trash.TotalCount > 0">({{trash.TotalCount}})</small>
                            <span ng-if="trash.TotalCount > 0" class="pull-right">
                                <span class="purgeall label label-danger" data-ng-click="purgeAll()"><i class="fa fa-times"></i> {{lbl.purgeAll}}</span>
                            </span>
                        </h4>
                    </div>
                    <ul class="list-group list-group panel-collapse collaps in" id="collapseFive">
                        <li class="list-group-item clearfix" data-ng-repeat="t in trash.Items">
                            <a href="{{t.RelativeUrl}}" class="text-ellipsis pull-left">{{t.Title}}</a>
                            <span class="pull-right">
                                <a title="{{lbl.restore}}" href="" data-ng-click="restore(t.Id)" class="restorethis"><i class="fa fa-refresh fa-sm"></i></a>
                                <a title="{{lbl.purge}}" href="" data-ng-click="purge(t.Id)" class="purgethis"><i class="fa fa-times fa-sm"></i></a>
                            </span>
                        </li>
                        <li ng-if="trash.TotalCount == 0" class="list-group-item">{{lbl.empty}}</li>
                    </ul>
                </div>
            </div>
            <div class="clearfix visible-xs"></div>
            <div class="col-xs-6 col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseSix">{{lbl.latestFromTheGallery}}</a>
                        </h4>
                    </div>
                    <ul class="list-group list-group panel-collapse collaps in" id="collapseSix">
                        <li class="list-group-item clearfix" data-ng-repeat="pkg in packages">
                            <div class="pull-left">
                                <a href="{{pkg.PackageUrl}}" target="_blank"> <img class="img-gallery" src="{{pkg.IconUrl}}" /></a>
                            </div>
                            <div class="pull-left item-info-gal">
                                <a href="{{pkg.PackageUrl}}" target="_blank">{{pkg.Title}}</a>
                                <span class="text-ellipsis">{{pkg.Description}}</span>
                            </div>
                        </li>
                    </ul>
                    <div id="gal-spinner" class="loaded text-center"><div><i class="fa fa-spinner fa-spin"></i></div></div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#collapseSeven">{{lbl.logs}}</a>
                        </h4>
                    </div>
                    <ul class="list-group list-group panel-collapse collaps in" id="collapseSeven">
                        <li data-ng-if="logItems.length > 0" class="list-group-item">
                            <a href="" data-ng-click="openLogFile()">{{lbl.loggedMessages}}</a>
                        </li>
                        <li ng-if="logItems.length == 0" class="list-group-item">{{lbl.empty}}</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="footer" data-ng-include src="'views/shared/_footer.html'"></div>
